﻿package mortal.game.resource.tableConfig
{
    import Message.DB.Tables.*;
    import com.gengine.resource.*;
    import flash.utils.*;

    public class EquipStrengthenConfig extends Object
    {
        private var _map:Dictionary;
        private static var _instance:EquipStrengthenConfig;

        public function EquipStrengthenConfig()
        {
            this._map = new Dictionary();
            if (_instance != null)
            {
                throw new Error(" EquipStrengthenConfig 单例 ");
            }
            this.init();
            return;
        }// end function

        private function write(param1:Object) : void
        {
            var _loc_2:TEquipStrengthen = null;
            var _loc_3:Object = null;
            for each (_loc_3 in param1)
            {
                
                _loc_2 = new TEquipStrengthen();
                _loc_2.level = _loc_3.level;
                _loc_2.consumeItemCode = _loc_3.consumeItemCode;
                _loc_2.level = _loc_3.level;
                _loc_2.consumeItemAmount = _loc_3.consumeItemAmount;
                _loc_2.consumeMoney = _loc_3.consumeMoney;
                _loc_2.successProbability = _loc_3.successProbability;
                _loc_2.mustFailedAmout = _loc_3.mustFailedAmout;
                _loc_2.mustSuccessAmount = _loc_3.mustSuccessAmount;
                _loc_2.addPercent = _loc_3.addPercent;
                _loc_2.rewardPercent = _loc_3.rewardPercent;
                this._map[_loc_2.level] = _loc_2;
            }
            return;
        }// end function

        public function init() : void
        {
            var _loc_1:* = ConfigManager.instance.getJSONByFileName("t_equip_strengthen.json");
            this.write(_loc_1);
            return;
        }// end function

        public function getInfoByLevel(param1:int) : TEquipStrengthen
        {
            return this._map[param1] as TEquipStrengthen;
        }// end function

        public static function get instance() : EquipStrengthenConfig
        {
            if (_instance == null)
            {
                _instance = new EquipStrengthenConfig;
            }
            return _instance;
        }// end function

    }
}
